/*
 * 
 */

package com.memorytech.starchive.xmlparser;

import java.io.InputStream;
import java.util.List;

import android.util.Log;

import com.memorytech.starchive.httpservice.IService.Methods;

/**
 * The Class ParserDataHelper.
 */
public class ParserDataHelper implements IServiceDataParser<List<Object>, InputStream> {

    /** The parser data helper. */
    private volatile static ParserDataHelper parserDataHelper;

    /**
     * Gets the single instance of ParserDataHelper.
     * 
     * @return single instance of ParserDataHelper
     */
    public static ParserDataHelper getInstance() {
        if (parserDataHelper == null) {

            synchronized (ParserDataHelper.class) {
                if (parserDataHelper == null) {
                    parserDataHelper = new ParserDataHelper();

                }

            }

        }
        return parserDataHelper;
    }

    /*
     * (non-Javadoc)
     * @see
     * com.aris.barcode.HttpService.IServiceDataParser#login(java.lang.Object)
     */
    @Override
    public List<Object> login(InputStream input) {
        // TODO Auto-generated method stub
        return null;
    }

    /*
     * (non-Javadoc)
     * @see
     * com.aris.barcode.HttpService.IServiceDataParser#search(java.lang.Object)
     */
    @Override
    public List<Object> search(InputStream input) {
        // TODO Auto-generated method stub
        return null;
    }

    /*
     * (non-Javadoc)
     * @see
     * com.aris.barcode.HttpService.IServiceDataParser#advancedSearch(java.lang
     * .Object)
     */
    @Override
    public List<Object> advancedSearch(InputStream input) {
        // TODO Auto-generated method stub
        return null;
    }

    /*
     * (non-Javadoc)
     * @see
     * com.aris.barcode.HttpService.IServiceDataParser#getBarcodeInfo(java.lang
     * .Object)
     */
    @Override
    public List<Object> getBarcodeInfo(InputStream input) {
        // TODO Auto-generated method stub
        return null;
    }

    /**
     * Parses the.
     * 
     * @param content the content
     * @param methodId the method id
     * @return the list
     */
    public List<Object> parse(InputStream content, Methods methodId) {
        // TODO Auto-generated method stub
        if (content == null) {
            return null;
        }
        try {

        } catch (Exception e) {
            // TODO: handle exception
            Log.e("Tamle", e.toString());
        }
        switch (methodId) {
            case login:
                return login(content);
            case search:
                return search(content);
            case advancedSearch:
                return advancedSearch(content);
            case getBarcodeInfo:
                return getBarcodeInfo(content);
            default:
                return null;
        }

    }

}
